package com.ruoyi.ade.llm.model;

import com.ruoyi.ade.llm.chunk.IAbstractChunkRequest;

/**
 * ADE知识检索配置
 */
public class AdeKnowledgeRetriveConfig {

    //private String model;  //向量模型使用 暂时不开放 默认一个模型
    /**
     * 分段方式    mark/pattern/none
     */
    private String chunkType;

    /**
     * 相似性得分阈值
     */
    private float simScoreThreshold;

    private String embedModel;

    /**
     * 需要检索的TOP n
     */
    private int topN;

    /**
     * 索引库
     */
    private String collection;

    /**
     * 调试模式    如果是调试模式 在检索ADE的时候 会保存 每个分割句子对应的检索结果， 否则就返回总体结果。
     */
    private boolean debug = false;

    public AdeKnowledgeRetriveConfig(){}

    public static AdeKnowledgeRetriveConfig getDefault(String collection){
        return new AdeKnowledgeRetriveConfig(collection, EmbeddingRequest.MODEL_DMETS,IAbstractChunkRequest.SPLIT_MARK,0.8f,10);
    }
    public AdeKnowledgeRetriveConfig(String collection, String embedModel,String chunkType, float simScoreThreshold, int topN) {
        this.collection = collection;
        this.embedModel = embedModel;
        this.chunkType = chunkType;
        this.simScoreThreshold = simScoreThreshold;
        this.topN = topN;
    }

    public String getEmbedModel() {
        return embedModel;
    }

    public void setEmbedModel(String embedModel) {
        this.embedModel = embedModel;
    }

    public String getChunkType() {
        return chunkType;
    }

    public void setChunkType(String chunkType) {
        this.chunkType = chunkType;
    }

    public float getSimScoreThreshold() {
        return simScoreThreshold;
    }

    public void setSimScoreThreshold(float simScoreThreshold) {
        this.simScoreThreshold = simScoreThreshold;
    }

    public int getTopN() {
        return topN;
    }

    public void setTopN(int topN) {
        this.topN = topN;
    }

    public String getCollection() {
        return collection;
    }

    public void setCollection(String collection) {
        this.collection = collection;
    }

    public boolean isDebug() {
        return debug;
    }

    public void setDebug(boolean debug) {
        this.debug = debug;
    }
}
